import { http } from "@/utils/http";
import { useUserStore } from "@/store";

// 首页列表
export const getContentList = (data: any) => {
  return http.get<any>(`/business/article/list`, data);
};
// 分类文章接口列表
export const getContentClassList = (data: any) => {
  return http.get<any>(`/business/article/classList`, data);
};
// 快捷入口
export const getQucikList = (data: any) => {
  return http.get<any>(`/business/shortcut/list`, data);
};
// 轮播图
export const getSwiperList = (data: any) => {
  return http.get<any>(`/business/images/list`, data);
};
// 二级分类
export const getClassificationList = (data: any) => {
  return http.get<any>(`/business/category/list`, data);
};
// 最热
export const getHotList = (data: any) => {
  return http.get<any>(`/business/article/hotList`, data);
};
// 真删除
export const doDel = (id: any) => {
  return http.delete<any>(`/business/article/${id}`);
};
// s收藏
export const getFavoriteList = (data: any) => {
  return http.get<any>(`/business/article/favoriteList`, data);
};
export const getSearchList = (data: any) => {
  return http.get<any>(`/business/article/homeSearch`, data);
};

// 公众号信息
export const httpGetBasicInfoDetail = (data: any) => {
  return http.get<any>(`/basicInfo/detail`, data);
};

// 资讯详情
export const httpGetInformationDetail = (data: any) => {
  return http.get<any>(`/news/detail`, data);
};

// 资讯列表
export const httpGetInformationList = (data: any) => {
  return http.get<any>(`/news/list`, data);
};

// 活动列表
export const httpGetActivityList = (data: any) => {
  return http.get<any>(`/activity/list`, data);
};

// 活动详情
export const httpGetActivityDetail = (data: any) => {
  return http.get<any>(`/activity/detail`, data);
};

// 资讯互动 点赞、评论、分享
export const httpAddInformationInteraction = (data: any) => {
  return http.post<any>(`/interaction/save`, data);
};

// 资讯互动 点赞、评论、分享
export const httpGetInformationInteractionDetail = (data: any) => {
  return http.get<any>(`/interaction/detail`, data);
};

// 获取资讯互动列表
export const httpGetInformationInteractionList = (data: any) => {
  return http.get<any>(`/interaction/list`, data);
};

// 点赞
export const httpAddNewsLike = (data: any) => {
  return http.get<any>(`/news/like`, data);
};
export const httpAddSquareLike = (data: any) => {
  return http.get<any>(`/activityParticipation/like`, data);
};

// 评论
export const httpAddComment = (data: any) => {
  return http.post<any>(`/interaction/save`, data);
};

// 修改基本信息
export const httpUpdateBasicInfo = (data: any) => {
  return http.post<any>(`/basicInfo/update`, data);
};

// 作品详情
export const httpParticipationDetail = (data: any) => {
  return http.get<any>(`/activityParticipation/detail`, data);
};

// 修改活动基本信息（上下架、置顶等操作）
export const updateActivityInfo = (data: any) => {
  return http.post<any>(`/activity/update`, data);
};

// 修改个人作品基本信息（上下架、置顶等操作）
export const updateActivityParticipationInfo = (data: any) => {
  return http.post<any>(`/activityParticipation/update`, data);
};

// 删除活动
export const removeActivity = (data: any) => {
  return http.post2<any>(`/activity/remove`, data);
};

// 删除个人作品
export const removeActivityParticipation = (data: any) => {
  return http.post2<any>(`/activityParticipation/remove`, data);
};
